#ifndef _TM_1668_H
#define _TM_1668_H

#define TM1668_CMD_MODE1 0x00
#define TM1668_CMD_MODE2 0x01
#define TM1668_CMD_DATA1 0x40
#define TM1668_CMD_ADDR1 0xC0
#define TM1668_CMD_DIS_ON 0x88
#define TM1668_CMD_DIS_OFF 0x80


typedef enum{
	ePanelFlagPower = 0,
	ePanelFlagTimer,
	ePanelFlagDisinfect,
	ePanelFlagIon,
	ePanelFlagMode,
	ePanelFlagTimingHour,
	ePanelFlagBGL,
	ePanelFlagFilter,
	ePanelFlagWifi,
	ePanelFlagMax,
}ePANEL_FLAG;

void tm1668Init(void);

unsigned char tm1668_disp_light_set(unsigned char value);
unsigned char tm1668_key_light_set(unsigned char value);
void tm1668_num_disp_off(void);
unsigned char tm1668_key_test(unsigned char value);

//void tm1668DelayMs(unsigned int ms);

void tm1668_led_flush_handle(void);

unsigned char tm1668_num_set(unsigned char index, unsigned char value);
unsigned char tm1668_num_val_set(unsigned int value);
unsigned char only_num_val_set(unsigned char value,unsigned char index);
unsigned char tm1668_flag_set(ePANEL_FLAG index,  unsigned char value);
void tm1668_flag_all_control(unsigned char value);
unsigned char tm1668_Key_single_set(ePANEL_FLAG index, unsigned char value);

#endif

